<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="vi" lang="vi"><head>
    <meta http-equiv="content-language" content="vi">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Marketing - CRM</title>
	<script type="text/javascript" src="../../../js/common_002.js"></script>
	<link rel="stylesheet" type="text/css" media="all" title="Style sheet" href="style.css">
    <link rel="stylesheet" type="text/css" media="all" title="Style sheet" href="../../../skins/css/formstyle.css">

  
</head>
<body>

<div style="visibility: hidden; position: absolute; overflow: hidden; padding: 0px; width: 0px; left: 0px; top: 0px;" id="WzTtDiV"></div>
<div id="wrr-body-main">
<div class="wrr-body">
<div class="wrr-body-r">
<div class="ajax-loading" id="system-busy" style="display:none;">
	<img src="popupmkt_files/loadding.gif" align="absmiddle">
</div>
<div style="width:100%; overflow: hidden">
<!-- overlay -->
<div id="global">
	<div id="overlay" onclick="parent_disable();">
		<div id="loading"><img src="popupmkt_files/loading.gif" align="loading" height="128px" width="128px"></div>
	</div>
</div>
<!-- end overlay -->
	  <table class="wrr-content" style="margin-top:0px;clear: both" cellpadding="0" cellspacing="0">
    <tbody><tr>
	
	<td id="centercolumn">

<script type="text/javascript">	
	function select_pro(id, name){
	
		document.getElementById("_idmkt").value = id
		document.getElementById("_tenmkt").value = name	
		
	}	
	
	
	function submit_select(){
		var id = opener.document.getElementById("idmkt");
		var name = opener.document.getElementById("tenmkt");
		var id_spp = opener.document.getElementById("idmkt_spp");
		var name_spp = opener.document.getElementById("tenmkt_spp");
		var id_stcd = opener.document.getElementById("idmkt_s");
		var name_stcd = opener.document.getElementById("tenmkt_s");
		var Chi_Phi = opener.document.getElementById("tt_chiphi");
		
		if( opener.document.getElementById("Chi_Phi"))
		{
			Chi_Phi.style.display = 'block';
		}
		if(id){
			id.value =  document.getElementById('_idmkt').value;
			name.value = document.getElementById("_tenmkt").value;
		}
					if(id_spp){
				id_spp.value =  document.getElementById('_idmkt').value;
				var idmk = $('#_idmkt').val();
				var ten = $('#_tenmkt').val();
				//var str_ten = "<a style='color:#3381b5;' title='Click d�? gio�i ha?n th�m du~ li�?u' href='http://tamnguyen.gencrm.com/modules/marketing/index/view?idmk="+idmk+"'><u>"+ten+"</u></a>";
				var str_ten = "<a style='color:#3381b5;' title='Click d�? gio�i ha?n th�m du~ li�?u' href='#' onclick='openpp_ghmk();'><u>"+ten+"</u></a>";
				name_spp.innerHTML = str_ten;
			}
				close_popup();
	}
</script>

   <?php include ("../../core/function.php");?>
<div id="" "divfrmsearch"="" class="searchFrm" style="overflow:hidden; width:590px; search_bg.jpg height: 105px; margin-top:10px; margin-bottom:10px; padding-bottom: 10px;">
		<form id="frmSearch" action="" method="post">
			
			<div class="row1" style="padding-top:0px;">
				<p><img src="../../../skins/images/search_20x20.png"><b>Tìm kiếm chiến dịch</b>	</p>
			</div>
			<div class="row1">
				<div class="col-left-per-50">
					<p>&nbsp;&nbsp;Tên chiến dịch: 
                    <input type="text" name="search" id="search" value="" />
                    </p>	
				</div>
             
				<div class="col-left-per-50">
					<p> Trạng thái:    
                 <select  name="trangthai" id="parent">                 
                    <option value="" selected="selected">--Lựa chọn--</option> 
                    <option  value="1" >Đang lên kế hoạch</option>
                    <option  value="2" >Sẵn sàng thực hiện</option>
                  	<option  value="3" >Đang thực hiện</option>
                	<option  value="4" >Hoàn thành</option>
                    <option  value="5" >Hủy</option>    
                    <option  value="6" >Tạm dừng</option>   
                   </select>
                    </p>	
					
				</div>
			</div>
			<div class="row1" align="center"> 
            <input type="submit" class="save" name="button" id="button" value="Tìm kiếm" />			
			<input class="save" value="Làm lại" type="reset">
          
             </div>
            
		</form>
	</div>
<form name="form" id="form" action="popupmkt.php?pagetype=popup" method="post">
	<input id="_idmkt" type="hidden">
	<input id="_tenmkt" type="hidden">
<div id="wrapper">
	<div class="tableHead">
		<div class="firstCol" style="width:15%;"><b>Mã</b> </div>
		<div class="Cols" style="width:60%">Tên chiến dịch</div>
		<div class="col-left-auto" style="margin-top: 5px; ">Trạng thái </div>
	</div>
<?php 
	$search=$_POST['search'];
	$trangthai=$_POST['trangthai'];
?>
  <?php   					
$sqlstring="select * from tb_marketing";	
if($trangthai!="" and $search!=""){$sqlstring.=" where Tenchiendich like '%$search%' and marketing_trangthai='$trangthai'"; }
if($search!="" and $trangthai==""){$sqlstring.=" where Tenchiendich like '%$search%'";}	
if($trangthai!="" and $search==""){$sqlstring.=" where marketing_trangthai='$trangthai'"; }
//include 'phantrang.php';
$sqlstring.=" order by IDmarketing desc";

$qr1=mysql_query($sqlstring); 
$n_record=mysql_num_rows($qr1); 
$i=0;
while($row=mysql_fetch_array($qr1)) 
{ 

?>
	<div class="row01" id="prorow_<?php echo $i++;?>" ondblclick="submit_select();" onclick="select_pro(<?php  echo $row["IDmarketing"]?>, &#39;<?php  echo $row["Tenchiendich"]?> &#39;); select_row(&#39;prorow&#39;, this, <?php echo $n_record;?>, &#39;row01&#39;, &#39;row02&#39;);" style="display: block;"> 
	<div class="firstCol" style="width:15%;"><?php  echo $row["Maso"]?></div> 
		<div class="Cols" style="width:60%"><?php  echo $row["Tenchiendich"]?></div>
		<div class="col-left-auto" style="margin-top: 5px; ">
        	<?php if($row['marketing_trangthai']==1){echo 'Đang lên kế hoạch';}?>
            <?php if($row['marketing_trangthai']==2){echo 'Sẵn sàng thực hiện';}?>
            <?php if($row['marketing_trangthai']==3){echo 'Đang thực hiện';}?>
            <?php if($row['marketing_trangthai']==4){echo 'Hoàn thành';}?>
            <?php if($row['marketing_trangthai']==5){echo 'Hủy';}?>
            <?php if($row['marketing_trangthai']==6){echo 'Tạm dừng';}?>
        </div>
	</div>
	
<?php }?>

<br><br>
<div class="row2" style="margin-top:5px" align="center">
		<div class="row1 mt8" style="float: left; width: 100%;">

	
	<div style="float:left;margin-left:5px;"><input value="Chọn" onclick="submit_select();" class="save" type="button">
				<input value="Đóng" onclick="close_popup();" class="save" type="button"></div>
</div>
			
	</div>
</div></form>

</div>
		<!-- End content module -->

		<!-- Start center bottom blocks loop -->
				<!-- End center bottom blocks loop -->

	</td>

	</tr>
</tbody></table>

</div>
</div>
</div>
</div>

</body></html>